import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { Ab03newVO, Ab03newForm, Ab03newQuery } from '@/api/yuanshidian/ab03new/types';

/**
 * 查询新离退人员信息列表
 * @param query
 * @returns {*}
 */

export const listAb03new = (query?: Ab03newQuery): AxiosPromise<Ab03newVO[]> => {
  return request({
    url: '/yuanshidian/ab03new/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询新离退人员信息详细
 * @param ID
 */
export const getAb03new = (ID: string | number): AxiosPromise<Ab03newVO> => {
  return request({
    url: '/yuanshidian/ab03new/' + ID,
    method: 'get'
  });
};

/**
 * 新增新离退人员信息
 * @param data
 */
export const addAb03new = (data: Ab03newForm) => {
  return request({
    url: '/yuanshidian/ab03new',
    method: 'post',
    data: data
  });
};

/**
 * 修改新离退人员信息
 * @param data
 */
export const updateAb03new = (data: Ab03newForm) => {
  return request({
    url: '/yuanshidian/ab03new',
    method: 'put',
    data: data
  });
};

/**
 * 删除新离退人员信息
 * @param ID
 */
export const delAb03new = (ID: string | number | Array<string | number>) => {
  return request({
    url: '/yuanshidian/ab03new/' + ID,
    method: 'delete'
  });
};
